<%-- 
    Document   : header
    Created on : 5 mars 2013, 16:43:35
    Author     : Alice
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Guitar Master</title>
        <link rel=stylesheet type="text/css" href="pages/css/style.css"/>
        <SCRIPT type="text/javascript">
            function trier(){
                window.location="rechercher.action";
            }
        </SCRIPT>
    </head>
    <body>
        <div id="content">
            <div id="bloc_top">
                <div class="top_right">
                    <c:choose>
                        <c:when test="${empty sessionScope['USER']}">
                            <a href="connection.jsp"><img 
                                    src="pages/img/btn_haut_connexion.png"/></a>
                            | <s:a action="commande">Mon panier</s:a> : <s:property value="#session['TOTAL_PRICE']" /> € <s:a 
                                action="commande" ><img src="pages/img/btn_haut_commander.png"/></s:a>
                        </c:when>
                        <c:otherwise>
                            <s:form action="disconnection" namespace="/" 
                                    cssStyle="margin-top:-15px; margin-bottom:-6px; text-align:center;" 
                                    theme="simple">
                                <s:submit value="Déconnexion" type="image" 
                                          src="pages/img/btn_haut_deconnexion.png" cssClass="espace_top"/>
                            </s:form>

                            Bonjour <a href="moncompte.jsp"><s:property 
                                    value="#session['USER'].firstName" /> <s:property value="#session['USER'].lastName" /></a> 
                            | Mon solde :  <fmt:formatNumber maxFractionDigits="2"><s:property value="#session['USER'].balance"/></fmt:formatNumber> <s:if test="#session['USER'].getCountry().devise=='USD'">$</s:if><s:else>€</s:else>
                            | <s:a action="commande">Mon panier</s:a> :<s:if test="#session['USER'].getCountry().devise=='USD'"> <fmt:formatNumber maxFractionDigits="2"><c:out value="${sessionScope['TOTAL_PRICE']*sessionScope['RATE']}" /></fmt:formatNumber> $</s:if><s:else> <s:property value="#session['TOTAL_PRICE']" /> €</s:else>
                            <s:a namespace="/" action="commande"><img 
                                    src="pages/img/btn_haut_commander.png"/></s:a>       
                        </c:otherwise>                         
                    </c:choose>
                </div>
            </div>

            <div id="ban"></div>

            <div id="rubrique">

                <a href="index.jsp"><img src="pages/img/rubrique_accueil.jpg" onmouseover="this.src='pages/img/rubrique_accueil_bis.jpg'" onmouseout="this.src='pages/img/rubrique_accueil.jpg'"/></a>
                <s:a action="rubrique" includeParams="get"><s:param name="idCategory" value="1" /><img src="pages/img/rubrique1.jpg" onmouseover="this.src='pages/img/rubrique1_bis.jpg'" onmouseout="this.src='pages/img/rubrique1.jpg'"/></s:a>
                <s:a action="rubrique" includeParams="get"><s:param name="idCategory" value="2" /><img src="pages/img/rubrique2.jpg" onmouseover="this.src='pages/img/rubrique2_bis.jpg'" onmouseout="this.src='pages/img/rubrique2.jpg'"/></s:a>
                <s:a action="rubrique" includeParams="get"><s:param name="idCategory" value="3" /><img src="pages/img/rubrique3.jpg" onmouseover="this.src='pages/img/rubrique3_bis.jpg'" onmouseout="this.src='pages/img/rubrique3.jpg'"/></s:a>
                <s:a action="rubriqueEnchere" includeParams="get"><img src="pages/img/rubrique4.jpg" onmouseover="this.src='pages/img/rubrique4_bis.jpg'" onmouseout="this.src='pages/img/rubrique4.jpg'"/></s:a>

            </div>

            <div id="recherche">
                <s:form namespace="/" action="rechercher" theme="simple">
                    <s:textfield name="champRecherche" />
                    <s:hidden name="trieValue" value="3"></s:hidden>
                    <s:select label="prix" headerKey="-1" headerValue="Select prix" list="#{'1':' <100', '2':' <500', '3':' <1000', '4':'<2000'}" 
                              name="rechPrice" value="-1"  />
                    <s:submit value="rechercher" type="image" style="padding-top: 4px;" src="pages/img/btn_recherche.png" cssClass="espace_top"/>
                </s:form> 
                Trier par : <s:a action="rechercher">
                    <s:param name="champRecherche"><c:out value="${champRecherche}"/></s:param>
                    <s:param name="rechPrice" value="-1"></s:param>
                    <s:param name="trieValue" value="3"></s:param>
                    nom</s:a>
                <s:a action="rechercher">
                    <s:param name="champRecherche"><c:out value="${champRecherche}"/></s:param>
                    <s:param name="rechPrice" value="-1"></s:param>
                    <s:param name="trieValue" value="2"></s:param>
                    - prix</s:a>
                <s:a action="rechercher">
                    <s:param name="champRecherche"><c:out value="${champRecherche}"/></s:param>
                    <s:param name="rechPrice" value="-1"></s:param>
                    <s:param name="trieValue" value="1"></s:param>
                    - note</s:a>

            </div><br /><br />